import Vue from 'vue'
import App from './App.vue'
import router from "./router";
import axios from "axios";
import filter from "./filter/filter";

Vue.config.productionTip = false;
Vue.prototype.$ajax = axios;
//解决每次ajax请求 对应的sessionid不一样问题
// axios.defaults.withCredentials =true;
//全局过滤器
Object.keys(filter).forEach((key)=>{
  Vue.filter(key,filter[key])
})

/**
 * axios拦截器
 */
/*axios.interceptors.request.use(function (config) {
  console.log("请求：", config);
  let token = Tool.getLoginUser().token;
  if (Tool.isNotEmpty(token)) {
    config.headers.token = token;
    console.log("请求headers增加token:", token);
  }
  return config;
}, error => {});
axios.interceptors.response.use(function (response) {
  console.log("返回结果：", response);
  return response;
}, error => {});*/
new Vue({
  router,/*加入路由配置*/
  render: h => h(App),
}).$mount('#app')
